home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk UserVolume 4 #7
/
Commodore_Disk_User_Vol.4_7_1991_-.d64
/
basic slider
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
3KB
|
78 lines
0 rem "basic slider" (c) dread 1991
7 a=a+1:if a=1 then load "chars.mc",8,1
9 poke 53280,14:poke 53281,6:poke 53272,24
10 print "[147]";
15 a$=" [194][193][211][201][195] [211]lider [196]emonstration program ":gosub 10000
20 a$=" ([195])[160][196]read 1991 ":gosub 10000
25 a$="----------------------------------------":gosub 10000
30 for a=0 to 1500:next
35 print "[147]";
40 a$="[212]his very simple text-sliding technique ":gosub 10000
45 a$="uses two key [194][193][211][201][195] commands: ":gosub 10000
50 a$=" ":gosub 10000
55 a$=" [210][201][199][200][212]$ and [204][197][206](a$). ":gosub 10000
57 a$="[160] ":gosub 10000
60 a$="[200]ow they are used in the subroutine will":gosub 10000
65 a$="be explained later, as will how to put ":gosub 10000
70 a$="the subroutine into your own programs. ":gosub 10000
75 rem **** wait for keypress ****
77 print ""
80 poke 198,0
85 a$=" [208]ress any key ":gosub 10000
87 print "[145][145][145][145][145]"
90 a$="[160] ":gosub 10000
95 if peek(198)=0 then 80
100 print "[147]"
105 a$=" [200]ow the [211]lider works ":gosub 10000
107 print "[145][145]"
110 a$=" [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183] ":gosub 10000
115 a$=" [212]he subroutine. ":gosub 10000
120 print " 10000 [198][207][210][160]a=[204][197][206](a$) [212][207][160]0 [211][212][197][208][160]-1"
125 print " 10005 [208][210][201][206][212] [210][201][199][200][212]$(a$,[204][197][206](a$)-a);";chr$(34);"";chr$(34)
130 print "[160]10010 [206][197][216][212]"
135 print "[160]10020 [210][197][212][213][210][206] "
140 a$="[201]f required, a pause can be set between ":gosub 10000
145 a$="lines 10005 and 10010, using the line: ":gosub 10000
150 print " 10007 [198][207][210] x=0 [212][207] (delay):[206][197][216][212]"
155 for a=0 to 3350:next a
160 print "[147]"
165 a$="[206]ow you can try the sliding technique ":gosub 10000
170 a$="out for yourself! ([205]ake sure that the ":gosub 10000
175 a$="text you want to slide is 40 characters ":gosub 10000
180 a$="long, or it will not work properly.) ":gosub 10000
185 input " [217]our text";t$
190 if len(t$)<40 or len(t$)>40 then print "[212]his will not work!":goto 185
195 a$=t$:print "[147]":gosub 10000
200 input "[193]nother go";g$:if g$<>"y" or g$<>"yes" then 210
205 goto 185
210 print "[147]";
215 a$="[200]ere is the program that slided that ":gosub 10000
220 a$="last piece of text.... ":gosub 10000
225 print " 10 a$=";chr$(34);t$;chr$(34)":gosub 10000"
230 print "[160]10000 [198][207][210] a=[204][197][206](a$) [212][207] 0 [211][212][197][208] -1"
235 print " 10005 [208][210][201][206][212] [210][201][199][200][212]$(a$,[204][197][206](a$)-a);";chr$(34);"";chr$(34)
240 print "[160]10010 [206][197][216][212]"
245 print " 10015 [210][197][212][213][210][206][160] "
250 a$=" [206]ow you should now everything there is ":gosub 10000
255 a$="to know about the [194]asic [211]lider, and can ":gosub 10000
260 a$="use the subroutine in your own programs.":gosub 10000
265 for a=0 to 3650:next
270 print "[147]";:poke 53272,23:poke 53280,4:poke 53281,0:poke 650,128
275 print " <[198]1> - load [211]lider subroutine."
280 print " <[198]3>[160]- restart [196]emonstration."
285 print " <[198]5>[160]- [209]uit and return to [194][193][211][201][195] [214]2"
290 get a$:if a$="" then 290
295 if asc(a$)<133 and asc(a$)>135 then goto 290
300 if a$=chr$(133) then load "slider.sub",8
305 if a$=chr$(134) then goto 9
310 if a$=chr$(135) then sys 64738
9999 end
10000 for a=len(a$) to 0 step -1
10005 print right$(a$,len(a$)-a);"[145]"
10010 next
10015 for x=0 to 264:next x
10020 return
10025 rem -------------------------
10030 rem lines 10000-10015 are the
10035 rem slider subroutine ^ ^ ^ ^